package com.ruoyi.business.domain.enums;

import lombok.Getter;

@Getter
public enum ProjectTypeEnum {
    HEIGHT("1", "身高体重","01"),
    WEIGHT("1", "身高体重","02"),
    LUNG_CAPACITY("2", "肺活量","04"),
    SIT_AND_REACH("3", "座位体前屈","06"),
    FIFTY_METER_DASH("4", "50米快速跑","30"),
//    LONG_DISTANCE_RUN("5", "中长跑","36"),
    SIT_UPS("6", "仰卧起坐","08"),
    STANDING_LONG_JUMP("7", "立定跳远","10"),
    SKIP_ROPE("8", "跳绳","07"),
    RUN_100("9", "100米跑","31"),
    RUN_200("10", "200米跑","32"),
    RUN_400("11", "400米跑","34"),
    RUN_800("12", "800米跑","35"),
    RUN_1000("13", "1000米跑","36"),
    RUN_1500("14", "1500米跑","37"),
    RUN_3000("15", "3000米跑","38"),

    ;

    private final String code;
    private final String value;
    private final String projectType;

    ProjectTypeEnum(String code, String value,String projectType) {
        this.code = code;
        this.value = value;
        this.projectType = projectType;
    }

    // 根据projectType查找枚举
    public static ProjectTypeEnum getEnumByProjectType(String projectType) {
        for (ProjectTypeEnum enumItem : ProjectTypeEnum.values()) {
            if (enumItem.getProjectType().equals(projectType)) {
                return enumItem;
            }
        }
        return null;
    }

    // 根据value查找枚举
    public static ProjectTypeEnum fromValue(String value) {
        for (ProjectTypeEnum enumItem : ProjectTypeEnum.values()) {
            if (enumItem.getValue().equals(value)) {
                return enumItem;
            }
        }
        return null;
    }
}